﻿@model IEnumerable<Sklep.Domain.Entities.Product>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h1>Wszytskie Produkty:</h1>
<table class="Grid">
    <tr>
        <th>ID</th>
        <th>Nazwa</th>
        <th class="NumericCol">Cena</th>
        <th>Akcje</th>
    </tr>
    @foreach(var item in Model)
    {
        <tr>
            <td>@item.ProductID</td>
            <td>@Html.ActionLink(item.Name,"Edit",new {item.ProductID})</td>
            <td class="NumericCol">@item.Price.ToString("c")</td>
            <td>
                @using(Html.BeginForm("Delete","Admin"))
                {
                    @Html.Hidden("productID",item.ProductID)
                    <input type="submit" value="Usuń"/>
                }
            </td>
        </tr>
    }
</table>
<p>
@Html.ActionLink("Dodaj nowy produkt","Create")
</p>
